home *** CD-ROM | disk | FTP | other *** search
- property ieUpdateButton, ieFXtextlist, pSelectedList, pSelected, pSelectedMember, pSelectedCast, pOriginalEffects, pNewEffects, pDrawMethod, pOriginalDrawMethod, pSource, pSourceMember, pSourceCast, pSourcePosition, pOriginalSource, pOriginalSourcePosition, pAlphaOnly, pRelToSprite, pOriginalRelToSprite, pEffectsList, pAllEffectsList, pUpdateStage, void
-
- on new me
- global fxDisplayMember
- set pSelected to void
- set pSource to void
- set pAllEffectsList to GetListOfAllEffects(fxDisplayMember)
- if getPos(pAllEffectsList, #nullfx) then
- deleteAt(pAllEffectsList, getPos(pAllEffectsList, #nullfx))
- end if
- getMemberNameAndCast(me)
- if count(pSelectedList) > 1 then
- alert("You have selected more than one AlphaMania member. Changes will affect all members, replacing any previous settings.")
- end if
- getMemberEffects(me)
- if validMember(me) then
- getSourceNameAndCast(me)
- end if
- updateFXtextlist(me)
- set pUpdateStage to not voidp(pSelected)
- set ieUpdateButton to new(script "CheckBox Button", [#sprite: 7, #cur: pUpdateStage, #active: 1, #callback: me])
- return me
- end
-
- on removeFromList me
- global fxCurObj, fxDisplayMember
- if not objectp(ieFXtextlist) then
- exit
- end if
- set i to the pCurActive of ieFXtextlist
- if (i < 1) or (i > count(the pElementList of ieFXtextlist)) then
- exit
- end if
- set SelectedEffect to getAt(the pElementList of ieFXtextlist, i)
- if findPos(GetEffectList(fxDisplayMember, SelectedEffect), SelectedEffect) > 0 then
- RemoveEffect(fxDisplayMember, SelectedEffect)
- clearTests(me)
- end if
- if not voidp(getaProp(pNewEffects, SelectedEffect)) then
- deleteProp(pNewEffects, SelectedEffect)
- end if
- updateFXtextlist(me)
- if objectp(fxCurObj) then
- if the peffect of fxCurObj = SelectedEffect then
- Settings()
- end if
- end if
- end
-
- on updateFXtextlist me, newObj
- set list to []
- if listp(pNewEffects) then
- repeat with i = 1 to count(pNewEffects)
- add(list, getPropAt(pNewEffects, i))
- end repeat
- end if
- if objectp(newObj) then
- set cur to the peffect of newObj
- else
- set cur to void
- end if
- set ieFXtextlist to new(script "Text List", [#list: list, #textField: "FXlist", #textSprite: 10, #cur: cur])
- end
-
- on getFXList me
- if voidp(pSelected) then
- set pEffectsList to []
- exit
- end if
- tell the stage
- preLoad(member pSelected)
- end tell
- tell the stage
- set pEffectsList to GetEffectList(pSelected)
- end tell
- repeat with i = count(pEffectsList) down to 1
- if getAt(pEffectsList, i) = #nullfx then
- deleteAt(pEffectsList, i)
- end if
- end repeat
- end
-
- on goToEffect me, effect
- global fxDisplayMember
- set mov to GetFXMovie(fxDisplayMember, effect)
- set page to GetFXPage(fxDisplayMember, effect)
- releasePuppets(8, 48)
- resetDisplay()
- set i to 0
- set pn to the fileName of the activeWindow
- if the platform contains "Mac" then
- set the itemDelimiter to ":"
- else
- set the itemDelimiter to "\"
- end if
- set pn to item 1 to the number of items in pn - 1 of pn
- repeat while 1
- set i to i + 1
- set file to getNthFileNameInFolder(pn, i)
- if file = EMPTY then
- alert(mov && "not found.")
- exit
- end if
- if file = mov then
- exit repeat
- end if
- if file = (mov & ".dir") then
- exit repeat
- end if
- if file contains mov then
- set mov to file
- exit repeat
- end if
- end repeat
- go(page, mov)
- set text to EMPTY
- if the number of member (string(effect) && "Help Text") > 0 then
- put field (string(effect) && "Help Text") after text
- end if
- set fxDisplayMember to the member of sprite 23
- preLoad(fxDisplayMember)
- put DescribeEffect(fxDisplayMember, effect) after text
- put text into field "Help Text"
- refresh(ieUpdateButton)
- end
-
- on getAllSelectedMembers me
- set pSelecteList to []
- tell the stage
- if the activeCastLib > 10000 then
- return []
- end if
- set pSelectedCast to the name of castLib the activeCastLib
- set selectedMemberList to the selection of castLib the activeCastLib
- repeat with x = 1 to count(selectedMemberList)
- set smallList to getAt(selectedMemberList, x)
- repeat with y = getAt(smallList, 1) to getAt(smallList, 2)
- if the type of member y of castLib pSelectedCast = #alpha then
- set pSelectedMember to the name of member y of castLib pSelectedCast
- set pSelected to member y of castLib pSelectedCast
- return pSelected
- end if
- end repeat
- end repeat
- end tell
- return void
- end
-
- on getMemberNameAndCast me
- set pSelectedList to []
- set pSelected to void
- set pSelectedMember to EMPTY
- set pSelectedCast to EMPTY
- tell the stage
- if the activeCastLib > 10000 then
- exit
- end if
- set pSelectedCast to the name of castLib the activeCastLib
- set selectedMemberList to the selection of castLib the activeCastLib
- repeat with x = 1 to count(selectedMemberList)
- set smallList to getAt(selectedMemberList, x)
- repeat with y = getAt(smallList, 1) to getAt(smallList, 2)
- if the type of member y of castLib pSelectedCast = #alpha then
- add(pSelectedList, member y of castLib pSelectedCast)
- if voidp(pSelected) then
- set pSelectedMember to the name of member y of castLib pSelectedCast
- set pSelected to member y of castLib pSelectedCast
- end if
- end if
- end repeat
- end repeat
- end tell
- end
-
- on getMemberEffects me
- if voidp(pSelected) then
- set list to [:]
- else
- tell the stage
- preLoad(member pSelected)
- set list to GetEffectList(pSelected)
- repeat with i = 1 to count(list)
- set effect to getPropAt(list, i)
- set effectlist to GetEffectArgs(pSelected, effect)
- setAt(list, i, effectlist)
- end repeat
- end tell
- if findPos(list, #nullfx) then
- deleteAt(list, findPos(list, #nullfx))
- end if
- end if
- set pOriginalEffects to list
- set pNewEffects to list
- if not voidp(pSelected) then
- tell the stage
- set pDrawMethod to the drawMethod of pSelected
- set pOriginalDrawMethod to the drawMethod of pSelected
- end tell
- end if
- end
-
- on setDrawMethod me, method
- set pDrawMethod to method
- if not voidp(pSelected) then
- tell the stage
- set the drawMethod of pSelected to pDrawMethod
- end tell
- end if
- end
-
- on setRelToSprite me, active
- set pRelToSprite to active
- if not voidp(pSelected) then
- tell the stage
- set the sourceRelToSprite of pSelected to pRelToSprite
- end tell
- end if
- end
-
- on resetProperties me
- if not voidp(pSelected) then
- tell the stage
- set the drawMethod of pSelected to pOriginalDrawMethod
- set the sourceRelToSprite of pSelected to pOriginalRelToSprite
- if pOriginalSource <> 0 then
- set the sourcemember of pSelected to pOriginalSource
- end if
- set the sourcePosition of pSelected to pOriginalSourcePosition
- end tell
- end if
- end
-
- on setMemberEffects me
- if count(pSelectedList) < 1 then
- exit
- end if
- clearTests(me)
- tell the stage
- repeat while count(pSelectedList) <= 1
- set m to getAt(ERROR, ERROR)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- repeat while ERROR <= (ERROR + 1)
- set m to getAt(ERROR, ERROR)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- repeat while ERROR <= (ERROR + 1)
- set m to getAt(ERROR, ERROR)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- repeat while ERROR <= (ERROR + 1)
- set m to getAt(ERROR, ERROR)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- set m to getAt(ERROR, ERROR + 1)
- RemoveAllEffects(m)
- repeat with i = 1 to count(pNewEffects)
- set effect to getPropAt(pNewEffects, i)
- set args to getAt(pNewEffects, i)
- AddEffect(m, effect, args)
- end repeat
- -- ERROR: Expected eq or nteq!
- end repeat
- end repeat
- end repeat
- end repeat
- end tell
- end
-
- on testStageMember me, obj
- if not pUpdateStage then
- exit
- end if
- if voidp(pSelected) then
- exit
- end if
- tell the stage
- TestEffect(pSelected, the peffect of obj, makePropertyList(obj))
- end tell
- end
-
- on tempStageMember me, obj, effect, args
- setaProp(pNewEffects, effect, makePropertyList(obj))
- if not pUpdateStage then
- exit
- end if
- if voidp(pSelected) then
- exit
- end if
- tell the stage
- TestEffect(pSelected, effect, args)
- updateStage()
- end tell
- end
-
- on updateEffects me, obj
- setaProp(pNewEffects, the peffect of obj, makePropertyList(obj))
- end
-
- on lingoToClipboard me, obj
- set effect to string(the peffect of obj)
- set text to effect & "( sprite yourSprite," && makePropertyList(obj) && ")"
- put text
- put text into field "Lingo To Clipboard"
- copyToClipBoard(member "Lingo To Clipboard")
- end
-
- on clearTests me
- if voidp(pSelected) then
- exit
- end if
- tell the stage
- EndAllTests(pSelected)
- end tell
- end
-
- on getSourceNameAndCast me
- tell the stage
- set pSource to the sourcemember of pSelected
- set pOriginalSource to the sourcemember of pSelected
- set pSourcePosition to the sourcePosition of pSelected
- set pOriginalSourcePosition to the sourcePosition of pSelected
- set pAlphaOnly to the alphaOnly of pSelected
- set pRelToSprite to the sourceRelToSprite of pSelected
- set pOriginalRelToSprite to the sourceRelToSprite of pSelected
- if voidp(pSource) or (pSource = 0) then
- set pSource to void
- set pSourceMember to EMPTY
- set pSourceCast to EMPTY
- else
- set pSourceMember to the name of pSource
- set pSourceCast to the name of castLib the castLibNum of pSource
- end if
- end tell
- end
-
- on validMember me
- return not voidp(pSelected)
- end
-
- on SetSourceMember me, pSource0
- if voidp(pSource0) then
- exit
- end if
- set pSource to pSource0
- if not voidp(pSelected) then
- tell the stage
- set pSourceMember to the name of pSource
- set pSourceCast to the name of castLib the castLibNum of pSource
- set the sourcemember of member pSelected to pSource
- end tell
- end if
- end
-
- on newSourcePosition me, pos
- set pSourcePosition to pos
- if not voidp(pSelected) then
- tell the stage
- set the sourcePosition of pSelected to pos
- end tell
- end if
- end
-
- on setSourceCast me, pSourceCast0
- set pSourceCast to pSourceCast0
- set pSource to void
- set pSouceMember to EMPTY
- tell the stage
- repeat with c = 1 to the number of castMembers of castLib pSourceCast
- if the type of member c of castLib pSourceCast = #bitmap then
- set pSource to member c of castLib pSourceCast
- set pSourceMember to the name of pSource
- set the sourcemember of member pSelected to pSource
- exit
- end if
- end repeat
- end tell
- end
-
- on checkBox me, refcon, status
- set pUpdateStage to status
- end
-
- on popupAddEffect me, sNum
- global fxDisplayMember, fxWindow
- set where to point(the right of sprite sNum, the top of sprite sNum)
- set choice to PopUpMenu(fxDisplayMember, where, pAllEffectsList)
- if choice > 0 then
- set effect to getAt(pAllEffectsList, choice)
- goToEffect(me, effect)
- end if
- end
-
- on setMemory me, n
- set fx to [#effects: pNewEffects]
- addProp(fx, #drawMethod, pDrawMethod)
- addProp(fx, #sourcemember, pSource)
- addProp(fx, #sourcePosition, pSourcePosition)
- set text to GetPref("AlphaMania FX Memory")
- if voidp(text) then
- set text to EMPTY
- end if
- put string(fx) into line n of text
- SetPref("AlphaMania FX Memory", text)
- beep(1)
- end
-
- on getMemory me, n
- set text to GetPref("AlphaMania FX Memory")
- if voidp(text) then
- set text to EMPTY
- end if
- set fx to value(line n of text)
- if listp(fx) then
- if count(fx) > 3 then
- setDrawMethod(me, getProp(fx, #drawMethod))
- SetSourceMember(me, getProp(fx, #sourcemember))
- newSourcePosition(me, getProp(fx, #sourcePosition))
- set pNewEffects to getProp(fx, #effects)
- updateFXtextlist(me)
- go("General Member Settings")
- beep(2)
- end if
- end if
- end
-
- on Release
- set released to 1
- end
-